/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ucb.sispro.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author felipe
 */
@Entity
@Table(name = "publicoalvo")
@NamedQueries({
    @NamedQuery(name = "PublicoAlvo.findAll", query = "SELECT p FROM PublicoAlvo p"),
    @NamedQuery(name = "PublicoAlvo.findByIdPublicoAlvo", query = "SELECT p FROM PublicoAlvo p WHERE p.idPublicoAlvo = :idPublicoAlvo"),
    @NamedQuery(name = "PublicoAlvo.findByPublicoAlvo", query = "SELECT p FROM PublicoAlvo p WHERE p.publicoAlvo = :publicoAlvo")})
public class PublicoAlvo extends br.ucb.sispro.model.Entity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idPublicoAlvo")
    private long idPublicoAlvo;
    @Basic(optional = false)
    @Column(name = "publicoAlvo")
    private String publicoAlvo;
    @ManyToMany(mappedBy = "publicoAlvoList")
    private List<Estabelecimento> estabelecimentoList;

    public PublicoAlvo() {
    }

    public PublicoAlvo(Integer idPublicoAlvo) {
        this.idPublicoAlvo = idPublicoAlvo;
    }

    public PublicoAlvo(Integer idPublicoAlvo, String publicoAlvo) {
        this.idPublicoAlvo = idPublicoAlvo;
        this.publicoAlvo = publicoAlvo;
    }

    public long getIdPublicoAlvo() {
        return idPublicoAlvo;
    }

    public void setIdPublicoAlvo(long idPublicoAlvo) {
        this.idPublicoAlvo = idPublicoAlvo;
    }

    public String getPublicoAlvo() {
        return publicoAlvo;
    }

    public void setPublicoAlvo(String publicoAlvo) {
        this.publicoAlvo = publicoAlvo;
    }

    public List<Estabelecimento> getEstabelecimentoList() {
        return estabelecimentoList;
    }

    public void setEstabelecimentoList(List<Estabelecimento> estabelecimentoList) {
        this.estabelecimentoList = estabelecimentoList;
    }

    @Override
    public String toString() {
        return "br.ucb.sispro.model.PublicoAlvo[ idPublicoAlvo=" + idPublicoAlvo + " ]";
    }

	@Override
	public String getNameForMessages() {
		// TODO Auto-generated method stub
		return "messagesPublicoAlvo";
	}

	@Override
	public long getId() {
		// TODO Auto-generated method stub
		return getIdPublicoAlvo();
	}

	@Override
	public String getSearchComlumnTable() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getSearchComlumnEntity() {
		// TODO Auto-generated method stub
		return null;
	}
    
}
